package org.feng.exception;

import lombok.Getter;
import org.feng.enums.Response;

/**
 * @Author feng
 * @Date 2022/7/12 17:32
 * @Description TODO
 */
@Getter
public class ServiceException extends RuntimeException {

    private final Integer code;
    private final String msg;

    public ServiceException(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public ServiceException(Response response) {
        this(response.getCode(), response.getMsg());
    }
}
